package com.mx.ipn.escom.wad.proyecto.documento.model;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * Representa el modelo para un comentario
 * @author jorge
 *
 */
@Entity
@Table(name = "comentario")
public class Comentario {
	
	private ComentarioId comentarioId;
	
	private Integer idComentario;
	
	private Integer idRevision;
	
	private String explicacion;
	
	private Integer numeroLinea;
	
	private Revision revision;
	
	public Comentario(){}

	/**
	 * @return the comentarioId
	 */
	@EmbeddedId
	public ComentarioId getComentarioId() {
		return comentarioId;
	}

	/**
	 * @param comentarioId the comentarioId to set
	 */
	public void setComentarioId(ComentarioId comentarioId) {
		this.comentarioId = comentarioId;
	}

	/**
	 * @return the idComentario
	 */
	@Transient
	public Integer getIdComentario() {
		return idComentario;
	}

	/**
	 * @param idComentario the idComentario to set
	 */
	public void setIdComentario(Integer idComentario) {
		this.idComentario = idComentario;
	}

	/**
	 * @return the idRevision
	 */
	@Transient
	public Integer getIdRevision() {
		return idRevision;
	}

	/**
	 * @param idRevision the idRevision to set
	 */
	public void setIdRevision(Integer idRevision) {
		this.idRevision = idRevision;
	}

	/**
	 * @return the explicacion
	 */
	@Column(name = "explicacion", nullable = false)
	public String getExplicacion() {
		return explicacion;
	}

	/**
	 * @param explicacion the explicacion to set
	 */
	public void setExplicacion(String explicacion) {
		this.explicacion = explicacion;
	}

	/**
	 * @return the numeroLinea
	 */
	@Column(name = "numero_linea", nullable = false)
	public Integer getNumeroLinea() {
		return numeroLinea;
	}

	/**
	 * @param numeroLinea the numeroLinea to set
	 */
	public void setNumeroLinea(Integer numeroLinea) {
		this.numeroLinea = numeroLinea;
	}

	/**
	 * @return the revision
	 */
	@ManyToOne
	@JoinColumn(name="id_revision", referencedColumnName = "id_revision", insertable = false, updatable = false)
	public Revision getRevision() {
		return revision;
	}

	/**
	 * @param revision the revision to set
	 */
	public void setRevision(Revision revision) {
		this.revision = revision;
	}
	
	
}
